#include "stdafx.h"

#ifndef _VERTEX_H
#define _VERTEX_H

struct VertexPC
{
	VertexPC():pos(D3DXVECTOR3(0,0,0)), color(D3DXVECTOR4(0,0,0,0)) {}
	VertexPC(float x, float y, float z, float r, float g, float b, float a):pos(D3DXVECTOR3(x,y,z)), color(D3DXVECTOR4(r,g,b,a)) {}
	VertexPC(float x, float y, float z, D3DXVECTOR4 col):pos(D3DXVECTOR3(x,y,z)), color(col) {}
	D3DXVECTOR3 pos;
	D3DXVECTOR4 color;
};

struct VertexPN
{
	D3DXVECTOR3 pos;
	D3DXVECTOR3 norm;
};

struct VertexPT
{
	VertexPT() {}
	VertexPT(float x, float y, float z, float u, float v):pos(D3DXVECTOR3(x,y,z)), tex(D3DXVECTOR2(u,v)) {}
	D3DXVECTOR3 pos;
	D3DXVECTOR2 tex;
};

struct VertexPNC
{
	VertexPNC() {}
	VertexPNC(float x, float y, float z, float nx, float ny, float nz, D3DXVECTOR4 col): pos(D3DXVECTOR3(x,y,z)), norm(D3DXVECTOR3(nx,ny,nz)), color(col) {}
	D3DXVECTOR3 pos;
	D3DXVECTOR3 norm;
	D3DXVECTOR4 color;
};
struct VertexPNT
{
	VertexPNT(): pos(0,0,0), norm(0, 0, 0), tex(0, 0, 0) {}
	VertexPNT(D3DXVECTOR3 ipos, D3DXVECTOR3 inorm, D3DXVECTOR3 itex): pos(ipos), norm(inorm), tex(itex) {}
	VertexPNT(float x, float y, float z, float nx, float ny, float nz, float tx, float ty, float tz): pos(D3DXVECTOR3(x,y,z)), norm(D3DXVECTOR3(nx,ny,nz)), tex(D3DXVECTOR3(tx, ty, tz)) {}
	D3DXVECTOR3 pos;
	D3DXVECTOR3 norm;
	D3DXVECTOR3 tex;
};
struct VertexPTNTB
{
	VertexPTNTB():pos(D3DXVECTOR3(0,0,0)),norm(D3DXVECTOR3(0,0,0)),tex(D3DXVECTOR2(0,0)),tan(D3DXVECTOR4(0,0,0,0)),bin(D3DXVECTOR4(0,0,0,0)) {}
	D3DXVECTOR3 pos;
	D3DXVECTOR3 norm;
	D3DXVECTOR2 tex;
	D3DXVECTOR4 tan;
	D3DXVECTOR4 bin;
};

struct Vertex
{
	Vertex(D3DXVECTOR3 pos, D3DXVECTOR3 norm, D3DXVECTOR2 tex, D3DXVECTOR3 tan): m_Pos(pos), m_Norm(norm), m_Tex(tex), m_Tan(tan) {}
	D3DXVECTOR3 m_Pos;
	D3DXVECTOR3 m_Norm;
	D3DXVECTOR2 m_Tex;
	D3DXVECTOR3 m_Tan;
};

struct VertexAnim
{
	VertexAnim(D3DXVECTOR3 pos, D3DXVECTOR4 bones, D3DXVECTOR4 weights, D3DXVECTOR3 norm, D3DXVECTOR2 tex, D3DXVECTOR3 tan): m_Pos(pos), m_Norm(norm), m_Tex(tex), m_Tan(tan) {}
	D3DXVECTOR3 m_Pos;
	D3DXVECTOR3 m_Norm;
	D3DXVECTOR2 m_Tex;
	D3DXVECTOR3 m_Tan;
	D3DXVECTOR4 m_Bones; 
	D3DXVECTOR4 m_Weights;
};

class AddVerticesToVec
{
public:
	AddVerticesToVec(vector<VertexPNT> &vertices):m_Vertices(vertices) {}
	void operator()(VertexPNT vert)
	{
		m_Vertices.push_back(vert);
	}
private:
	vector<VertexPNT> &m_Vertices;
};

#endif